package com.bluesky.mapper.ConcurrencySafe;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bluesky.po.ConcurrencySafe.GoodsPO;
import org.apache.ibatis.annotations.Param;

public interface GoodsMapper extends BaseMapper<GoodsPO> {

    /**
     * 下单
     * @param goodsId  商品id
     * @param num      商品数量
     * @return
     */
    int placeOrder1(@Param("goodsId") String goodsId,@Param("num") Integer num);

    /**
     * 下单
     * @param goodsId  商品id
     * @param num      商品数量
     * @param expectVersion version  商品版本
     * @return
     */
    int placeOrder2(@Param("goodsId") String goodsId,@Param("num") Integer num,@Param("expectVersion") long expectVersion);

    /**
     * 下单
     * @param goodsId  商品id
     * @param num      商品数量
     * @return
     */
    int placeOrder3(@Param("goodsId") String goodsId,@Param("num") Integer num);
}
